home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-11 | 4.9 KB | 219 lines | [TEXT/MPS ] |
- ;
- ; File: CursorDevices.a
- ;
- ; Copyright: © 1984-1994 by Apple Computer, Inc.
- ; All rights reserved.
- ;
- ; Version: Universal Interfaces 2.0a3 ETO #16, MPW prerelease. Friday, November 11, 1994.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
-
- IF &TYPE('__CURSORDEVICES__') = 'UNDEFINED' THEN
- __CURSORDEVICES__ SET 1
-
-
- IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
- include 'Types.a'
- ENDIF
- ; include 'ConditionalMacros.a' ;
-
- IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
- include 'MixedMode.a'
- ENDIF
- ; ButtonOpcodes
-
- kButtonNoOp EQU 0 ; No action for this button
- kButtonSingleClick EQU 1 ; Normal mouse button
- kButtonDoubleClick EQU 2 ; Click-release-click when pressed
- kButtonClickLock EQU 3 ; Click on press, release on next press
- kButtonCustom EQU 6 ; Custom behavior, data = CursorDeviceCustomButtonUPP
-
- ; Device Classes
- kDeviceClassAbsolute EQU 0 ; a flat-response device
- kDeviceClassMouse EQU 1 ; mechanical or optical mouse
- kDeviceClassTrackball EQU 2 ; trackball
- kDeviceClass3D EQU 6 ; a 3D pointing device
-
- ; Structures used in Cursor Device Manager calls
- CursorData RECORD 0
- nextCursorData ds.l 1 ; next in global list
- displayInfo ds.l 1 ; unused (reserved for future)
- whereX ds.l 1 ; horizontal position
- whereY ds.l 1 ; vertical position
- where ds Point ; the pixel position
- isAbs ds.b 1 ; has been stuffed with absolute coords
- buttonCount ds.b 1 ; number of buttons currently pressed
- screenRes ds.w 1 ; pixels per inch on the current display
- privateFields ds.w 22 ; fields use internally by CDM
- sizeof EQU 68
- ENDR
-
- CursorDevice RECORD 0
- nextCursorDevice ds.l 1 ; pointer to next record in linked list
- whichCursor ds.l 1 ; pointer to data for target cursor
- refCon ds.l 1 ; application-defined
- unused ds.l 1 ; reserved for future
- devID ds.l 1 ; device identifier (from ADB reg 1)
- resolution ds.l 1 ; units/inch (orig. from ADB reg 1)
- devClass ds.b 1 ; device class (from ADB reg 1)
- cntButtons ds.b 1 ; number of buttons (from ADB reg 1)
- filler1 ds.b 1 ; reserved for future
- buttons ds.b 1 ; state of all buttons
- buttonOp ds.b 8 ; action performed per button
- buttonTicks ds.l 8 ; ticks when button last went up (for debounce)
- buttonData ds.l 8 ; data for the button operation
- doubleClickTime ds.l 1 ; device-specific double click speed
- acceleration ds.l 1 ; current acceleration
- privateFields ds.w 15 ; fields used internally to CDM
- sizeof EQU 138
- ENDR
-
- ; for use with CursorDeviceButtonOp when opcode = kButtonCustom
- IF GENERATING68K THEN
- Macro
- _CursorDeviceMove
- moveq #0,d0
- dc.w $AADB
- EndM
- ELSE
- IMPORT CursorDeviceMove
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CursorDeviceMoveTo
- moveq #1,d0
- dc.w $AADB
- EndM
- ELSE
- IMPORT CursorDeviceMoveTo
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CursorDeviceFlush
- moveq #2,d0
- dc.w $AADB
- EndM
- ELSE
- IMPORT CursorDeviceFlush
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CursorDeviceButtons
- moveq #3,d0
- dc.w $AADB
- EndM
- ELSE
- IMPORT CursorDeviceButtons
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CursorDeviceButtonDown
- moveq #4,d0
- dc.w $AADB
- EndM
- ELSE
- IMPORT CursorDeviceButtonDown
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CursorDeviceButtonUp
- moveq #5,d0
- dc.w $AADB
- EndM
- ELSE
- IMPORT CursorDeviceButtonUp
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CursorDeviceButtonOp
- moveq #6,d0
- dc.w $AADB
- EndM
- ELSE
- IMPORT CursorDeviceButtonOp
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CursorDeviceSetButtons
- moveq #7,d0
- dc.w $AADB
- EndM
- ELSE
- IMPORT CursorDeviceSetButtons
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CursorDeviceSetAcceleration
- moveq #8,d0
- dc.w $AADB
- EndM
- ELSE
- IMPORT CursorDeviceSetAcceleration
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CursorDeviceDoubleTime
- moveq #9,d0
- dc.w $AADB
- EndM
- ELSE
- IMPORT CursorDeviceDoubleTime
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CursorDeviceUnitsPerInch
- moveq #10,d0
- dc.w $AADB
- EndM
- ELSE
- IMPORT CursorDeviceUnitsPerInch
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CursorDeviceNextDevice
- moveq #11,d0
- dc.w $AADB
- EndM
- ELSE
- IMPORT CursorDeviceNextDevice
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CursorDeviceNewDevice
- moveq #12,d0
- dc.w $AADB
- EndM
- ELSE
- IMPORT CursorDeviceNewDevice
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CursorDeviceDisposeDevice
- moveq #13,d0
- dc.w $AADB
- EndM
- ELSE
- IMPORT CursorDeviceDisposeDevice
- ENDIF
-
- ENDIF ; __CURSORDEVICES__
-